Skip to content

OCPEDGE-2094: Add console notification for pacemaker podman-etcd failures#1654

Open
lucaconsalvi wants to merge 10 commits into
openshift:mainfrom
lucaconsalvi:ocpedge-2094-console-notification
Open

OCPEDGE-2094: Add console notification for pacemaker podman-etcd failures#1654
lucaconsalvi wants to merge 10 commits into
openshift:mainfrom
lucaconsalvi:ocpedge-2094-console-notification

Conversation

@lucaconsalvi

@lucaconsalvi lucaconsalvi commented Jul 16, 2026

Copy link
Copy Markdown

Summary

  • Add a new ConsoleNotificationController that watches the PacemakerCluster CR and manages a ConsoleNotification banner in the OpenShift web console when pacemaker health problems are detected
  • The controller detects: unhealthy etcd resources, fencing unavailability, maintenance mode, and stale pacemaker status
  • The banner is automatically removed when health is restored
  • Follows existing patterns: shares the PacemakerCluster informer with healthcheck and metrics controllers, registered alongside them in runPacemakerControllers()

Files Changed

File Change
pkg/tnf/pkg/pacemaker/consolenotification.go New controller + health evaluation logic
pkg/tnf/pkg/pacemaker/consolenotification_test.go 9 table-driven tests covering all failure modes
pkg/tnf/operator/starter.go Register the new controller in runPacemakerControllers()

Test plan

  • Unit tests pass for all health evaluation scenarios (healthy, stale, maintenance, node offline, etcd unhealthy, fencing unavailable, multiple problems, nil nodes, offline-skip)
  • All existing TNF package tests pass
  • Full binary builds cleanly
  • Manual verification on a TNF cluster: disable etcd resource, verify banner appears, re-enable, verify banner removed

Jira: https://issues.redhat.com/browse/OCPEDGE-2094

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added OpenShift Console notifications highlighting Pacemaker health issues, including degraded and troubleshooting conditions.
    • Added lifecycle events showing progress through the etcd transition and setup process.
    • Added clearer health status reporting for stale, offline, fencing, and resource conditions.
  • Bug Fixes

    • Console notifications are automatically removed when health information is unavailable or the cluster is healthy.
    • Console integration gracefully handles unavailable notification resources.
  • Tests

    • Added coverage for health evaluation, notification behavior, and transition event recording.

lucaconsalvi and others added 3 commits July 16, 2026 09:50
Add event recording to the TNF setup runner and etcd transition
code so the full CEO-to-pacemaker handoff is observable via
`kubectl get events -n openshift-etcd`.

Nine events are emitted across the transition lifecycle:
- runner.go: auth, cluster, fencing, etcd resource, constraints
- etcd.go: transition started, waiting, static pod removed, completed

Events use the direct K8s API (not library-go Recorder) since the
setup runner is a short-lived Job. Failures are logged but never
block the transition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The event reason (e.g. EtcdTransitionAuthCompleted) was used directly
in metadata.name which should be a valid lowercase DNS subdomain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 16, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 16, 2026

Copy link
Copy Markdown

@lucaconsalvi: This pull request references OCPEDGE-2094 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Add a new ConsoleNotificationController that watches the PacemakerCluster CR and manages a ConsoleNotification banner in the OpenShift web console when pacemaker health problems are detected
  • The controller detects: unhealthy etcd resources, fencing unavailability, maintenance mode, and stale pacemaker status
  • The banner is automatically removed when health is restored
  • Follows existing patterns: shares the PacemakerCluster informer with healthcheck and metrics controllers, registered alongside them in runPacemakerControllers()

Files Changed

File Change
pkg/tnf/pkg/pacemaker/consolenotification.go New controller + health evaluation logic
pkg/tnf/pkg/pacemaker/consolenotification_test.go 9 table-driven tests covering all failure modes
pkg/tnf/operator/starter.go Register the new controller in runPacemakerControllers()

Test plan

  • Unit tests pass for all health evaluation scenarios (healthy, stale, maintenance, node offline, etcd unhealthy, fencing unavailable, multiple problems, nil nodes, offline-skip)
  • All existing TNF package tests pass
  • Full binary builds cleanly
  • Manual verification on a TNF cluster: disable etcd resource, verify banner appears, re-enable, verify banner removed

Jira: https://issues.redhat.com/browse/OCPEDGE-2094

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 16, 2026
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The PR refactors pacemaker health evaluation, adds console health notifications, wires the new controller into startup, and records TNF setup transition events through Kubernetes Events.

Changes

Pacemaker and TNF observability

Layer / File(s) Summary
Health evaluation refactor
pkg/tnf/pkg/pacemaker/healthcheck.go, pkg/tnf/pkg/pacemaker/healthcheck_test.go
Health computation and condition checks use package-level functions and exported status constants, with updated transition and evaluation tests.
Console notification controller
pkg/tnf/pkg/pacemaker/consolenotification.go, pkg/tnf/pkg/pacemaker/consolenotification_test.go
Pacemaker problems are classified into degraded and troubleshooting categories, then applied or deleted as dynamic ConsoleNotification resources.
Controller startup wiring
pkg/tnf/operator/starter.go
The dynamic client is passed to Pacemaker startup, which starts the console notification controller.
TNF transition event recording
pkg/tnf/pkg/tools/events.go, pkg/tnf/pkg/etcd/*, pkg/tnf/setup/runner.go, pkg/tnf/hack/test-transition-events.sh
Setup and etcd static-container transition stages emit Kubernetes Events, with fake-client coverage and a shell verification script.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant pacemakerInformer
  participant consoleNotificationController
  participant BuildHealthStatusFromCR
  participant dynamicClient
  pacemakerInformer->>consoleNotificationController: synchronize PacemakerCluster
  consoleNotificationController->>BuildHealthStatusFromCR: build health status
  BuildHealthStatusFromCR-->>consoleNotificationController: errors and warnings
  consoleNotificationController->>dynamicClient: apply or delete console notification
Loading

Possibly related PRs

Suggested reviewers: slintes, fonta-rh

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.96% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding Pacemaker console notifications for etcd-related failures.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All modified test titles are static strings or Go test names; none contain dynamic values, timestamps, UUIDs, node/IP/namespace names, or generated identifiers.
Test Structure And Quality ✅ Passed PASS: The new tests are single-purpose table-driven unit tests with fake clients, no Ginkgo waits, and no external resources to clean up.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the diff only adds standard Go unit tests and controller code, with no MicroShift-unsupported test APIs or labels to review.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; changed Go tests use testing, and no SNO-sensitive multi-node assumptions appear.
Topology-Aware Scheduling Compatibility ✅ Passed New controller is API-only: it watches PacemakerCluster and manages ConsoleNotification objects; no nodeSelector, affinity, spread, or replica logic was added.
Ote Binary Stdout Contract ✅ Passed No stdout writes appear in main/init/suite setup; the binary only uses klog.Fatal and klog defaults to stderr in vendor docs.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the changes are unit tests/helpers only, with no cluster-external connectivity dependencies.
No-Weak-Crypto ✅ Passed No weak crypto primitives, custom crypto, or secret/token constant-time comparison issues appear in the touched files.
Container-Privileges ✅ Passed No changed file adds privileged/hostNetwork/hostIPC/allowPrivilegeEscalation/SYS_ADMIN; the PR only adds controller/event logic.
No-Sensitive-Data-In-Logs ✅ Passed New logs are generic lifecycle/status messages; no added logging emits passwords, tokens, PII, or hostnames.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
pkg/tnf/pkg/pacemaker/consolenotification_test.go (1)

38-196: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Add tests for the ConsoleNotification lifecycle.

Health evaluation is covered, but creation, deletion, update drift, conflict/error handling, and preservation of unmanaged metadata are not. Exercise sync with a fake dynamic client before relying on this controller in production.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/tnf/pkg/pacemaker/consolenotification_test.go` around lines 38 - 196, Add
lifecycle-focused tests for the ConsoleNotification controller’s sync flow,
using a fake dynamic client to cover creation, deletion, update drift, resource
conflicts/errors, and preservation of unmanaged metadata. Keep the existing
evaluateHealth tests unchanged, and assert the resulting resource state and
propagated handling through the relevant sync/controller methods.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/tnf/pkg/pacemaker/consolenotification_test.go`:
- Around line 104-120: Update the “offline node skips resource and fencing
checks” test setup around makeNodeWithConditions to explicitly set the node’s
Etcd Healthy condition to False before evaluation, while preserving the offline
and fencing-unavailable conditions and the expected offline-only notification.

In `@pkg/tnf/pkg/pacemaker/consolenotification.go`:
- Line 180: Update the logging statements in the console notification creation
and related paths around klog.Infof so they do not include the notification
text; instead log the operation and notification problem count, avoiding
exposure of node hostnames while retaining useful summary information.
- Around line 102-112: Update the Pacemaker status checks around
getConditionStatus and the cr.Status.Nodes guard so uninitialized status is
reported as unhealthy: flag zero LastUpdated, treat missing or
metav1.ConditionUnknown conditions as problems, and report nil or empty Nodes
according to the CRD’s catastrophic-state guidance. Preserve existing stale,
maintenance, and healthy-status behavior, and add coverage for uninitialized and
Unknown statuses.
- Around line 187-195: Update the reconciliation logic around existingText and
the ConsoleNotification Update call to compare and reconcile every
controller-owned field, including backgroundColor, color, link, location, and
text. Mutate a copy of existing rather than updating u directly, preserve its
annotations, finalizers, labels, and other metadata, set the desired owned
fields on the copy, retain the existing resource version, and submit that copy
through the dynamic client.

---

Nitpick comments:
In `@pkg/tnf/pkg/pacemaker/consolenotification_test.go`:
- Around line 38-196: Add lifecycle-focused tests for the ConsoleNotification
controller’s sync flow, using a fake dynamic client to cover creation, deletion,
update drift, resource conflicts/errors, and preservation of unmanaged metadata.
Keep the existing evaluateHealth tests unchanged, and assert the resulting
resource state and propagated handling through the relevant sync/controller
methods.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d68afcfd-0760-4e1e-83e7-699379c44f13

📥 Commits

Reviewing files that changed from the base of the PR and between 1fe5873 and caead3c.

📒 Files selected for processing (3)
  • pkg/tnf/operator/starter.go
  • pkg/tnf/pkg/pacemaker/consolenotification.go
  • pkg/tnf/pkg/pacemaker/consolenotification_test.go

Comment thread pkg/tnf/pkg/pacemaker/consolenotification_test.go Outdated
Comment thread pkg/tnf/pkg/pacemaker/consolenotification.go Outdated
Comment thread pkg/tnf/pkg/pacemaker/consolenotification.go Outdated
Comment thread pkg/tnf/pkg/pacemaker/consolenotification.go Outdated
@lucaconsalvi

lucaconsalvi commented Jul 17, 2026

Copy link
Copy Markdown
Author

Manual Testing on TNF Cluster

Tested the console notification on a live TNF baremetal cluster deployed via cluster-bot with a custom CEO image built from this PR.

Cluster: workflow-launch baremetalds-two-node-fencing with release image containing PR #1654

Test 1 — Banner appears on pacemaker failure

Triggered maintenance mode via pcs property set maintenance-mode=true on master-0. After the CronJob updated the PacemakerCluster CR (~90s), the controller created the ConsoleNotification:

$ oc get consolenotification pacemaker-etcd-failure -o jsonpath='{.spec.text}'
Pacemaker cluster is in maintenance mode. Etcd resource is unhealthy on node master-0. Etcd resource is unhealthy on node master-1. Check pacemaker status for details.

Red banner visible at the top of the OpenShift web console with the "Troubleshooting guide" link.

Test 2 — Banner disappears when health is restored

Disabled maintenance mode via pcs property set maintenance-mode=false. After the CronJob updated the CR:

$ oc get consolenotifications
No resources found

PacemakerCluster CR returned to Healthy=True, InService=True. Banner disappeared from the console.

Result

PASS — Full lifecycle verified: banner creation, content accuracy, troubleshooting link, and automatic cleanup on health restoration.

Screenshot 2026-07-17 at 13 37 10 Screenshot 2026-07-17 at 15 36 58

@lucaconsalvi
lucaconsalvi marked this pull request as ready for review July 17, 2026 13:41
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 17, 2026
@openshift-ci
openshift-ci Bot requested review from fonta-rh and slintes July 17, 2026 13:43

@fonta-rh fonta-rh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: requesting changes

Four items, one blocking.

1. [Blocking] evaluateHealth re-derives health logic that healthcheck.go already computes — and the two implementations already disagree

I think we can get a much leaner code by trying to reuse the existing logic instead of reimplementing it outselves

evaluateHealth() checks staleness, maintenance mode, offline nodes, unhealthy etcd, and fencing unavailability — the same conditions healthcheck.go's buildHealthStatusFromCR / checkClusterConditions / checkNodeStatuses already evaluate. Two independent implementations in the same package is a drift magnet, and the drift has already happened:

  • Zero LastUpdated: healthcheck.go:292 treats LastUpdated.IsZero() as an error ("CR has no status populated"). evaluateHealth:102 guards the staleness check with !cr.Status.LastUpdated.IsZero(), so a status collector that never successfully runs (crash-loop, RBAC, image pull failure) produces zero-value LastUpdated forever — and the banner never appears. This is the exact scenario the banner exists to surface.

  • Kubelet health silently skipped: evaluateHealth:125 has if res.Name != PacemakerClusterResourceNameEtcd { continue }, filtering out Kubelet entirely. healthcheck.go:563 (getNodeResourceSummaries) iterates all resources unfiltered — confirmed by healthcheck_test.go's unhealthy_kubelet test case. Result: oc get co etcd shows Degraded=True from Kubelet failure, but the console banner stays silent.

The PR title scopes to "pacemaker podman-etcd failures" but evaluateHealth also checks staleness, maintenance mode, offline nodes, and fencing — it is general health, not etcd-specific. The narrow Jira (OCPEDGE-2094) contributed to the etcd-only resource filter, but we should consolidate all notification conditions here rather than building incrementally on the duplication. Let's use this PR to add all the notifications we think we want, no need to limit ourselves by the scope defined 1 year ago.

Proposed fix: Have the console notification controller consume the HealthStatus that healthcheck.go already produces (or extract a shared health evaluation function). The controller's job is presentation — translating problems into banner text — not re-deriving what healthcheck already knows. The HealthStatus.Errors and HealthStatus.Warnings slices already contain the human-readable strings this controller needs.

2. No Console capability check — infinite error loop on edge clusters

If the Console cluster capability is disabled (common on minimal/edge footprints — TNF's target), the consolenotifications API does not exist. Every 30s sync fails with an API error, logged and retried forever. No degraded condition, no circuit breaker — permanent log noise for the lifetime of the cluster.

The codebase has an established pattern for this: ceohelpers/machine_api.go checks ClusterVersionCapabilityMachineAPI before touching machine API resources. Follow the same pattern — check Console capability at startup or on first sync failure, log once at Info, and no-op all subsequent syncs.

3. Hand-rolled CRUD — use library-go resourceapply helpers

ensureNotification / deleteNotification hand-roll ~70 lines of Get→Create/Update and Delete logic. vendor/.../resourceapply/monitoring.go exports ApplyUnstructuredResourceImproved and DeleteUnstructuredResource — both already used in this codebase for ServiceMonitor, PrometheusRule, and Alertmanager resources. They handle metadata merge, event recording, and NotFound tolerance out of the box.

The hand-rolled version also skips event recording entirely — eventRecorder is available (passed to the factory) but never used for ConsoleNotification CRUD. Every other controller in this codebase that creates/updates resources emits recorder events. Switching to the library-go helpers fixes this for free and drops ~50 lines.

4. Add sync-level tests after the refactor

Only evaluateHealth is tested today. Once the refactor from point 1 and the resourceapply switch from point 3 land, the remaining testable surface is the sync() orchestration: "given this HealthStatus, do we create, update, or delete the banner?" and the banner text formatting. The codebase already has fakedynamic.NewSimpleDynamicClient in starter_test.go — use it to cover the sync paths.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/tnf/pkg/pacemaker/consolenotification.go (1)

180-190: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

consoleUnavailable is latched permanently and never re-checked.

Once meta.IsNoMatchError is hit, consoleUnavailable is set to true and sync returns early forever. On clusters where the Console API/CRD is installed after this operator starts (or re-registered), notification management stays disabled until the operator restarts. Consider periodically re-probing (e.g. reset the flag on resync) rather than latching it for the process lifetime.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/tnf/pkg/pacemaker/consolenotification.go` around lines 180 - 190, The
consoleUnavailable flag set by filterConsoleError must not permanently disable
notification management after a transient NoMatchError. Update the sync/resync
flow and filterConsoleError so the flag is periodically reset and the Console
API is re-probed, while preserving the existing behavior of ignoring
NoMatchError and returning other errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/tnf/pkg/pacemaker/consolenotification.go`:
- Around line 128-134: Update the notification flow around
BuildHealthStatusFromCR and classifyProblems to detect a PacemakerCluster CR
with zero LastUpdated before classifying problems, then remove any existing
console notification and return without creating a banner. Add a sync test
covering this uninitialized-status case.

---

Nitpick comments:
In `@pkg/tnf/pkg/pacemaker/consolenotification.go`:
- Around line 180-190: The consoleUnavailable flag set by filterConsoleError
must not permanently disable notification management after a transient
NoMatchError. Update the sync/resync flow and filterConsoleError so the flag is
periodically reset and the Console API is re-probed, while preserving the
existing behavior of ignoring NoMatchError and returning other errors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c80ba177-91d4-4170-8942-cf31caf045f7

📥 Commits

Reviewing files that changed from the base of the PR and between 6b659b1 and 67f426c.

📒 Files selected for processing (9)
  • hack/test-transition-events.sh
  • pkg/tnf/pkg/etcd/etcd.go
  • pkg/tnf/pkg/etcd/etcd_test.go
  • pkg/tnf/pkg/pacemaker/consolenotification.go
  • pkg/tnf/pkg/pacemaker/consolenotification_test.go
  • pkg/tnf/pkg/pacemaker/healthcheck.go
  • pkg/tnf/pkg/pacemaker/healthcheck_test.go
  • pkg/tnf/pkg/tools/events.go
  • pkg/tnf/setup/runner.go

Comment thread pkg/tnf/pkg/pacemaker/consolenotification.go
lucaconsalvi and others added 7 commits July 21, 2026 15:43
TNF-specific manual validation script belongs under the TNF directory
tree rather than the repo-wide hack/ directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tnf-test=true label to mock events so the cleanup command only
targets test events, not real cluster diagnostic data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ures

Surface pacemaker health problems directly in the OpenShift web console
via a ConsoleNotification banner. When etcd resources fail, fencing
becomes unavailable, or pacemaker status goes stale, a red banner
appears linking to the troubleshooting guide. The banner is removed
automatically when health is restored.

New controller shares the existing PacemakerCluster informer with the
healthcheck and metrics controllers, following the same registration
pattern in runPacemakerControllers().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Improves readability of multi-problem notifications by joining
problems with ". " instead of "; ".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The "offline node skips resource and fencing checks" test claimed etcd
was unhealthy but makeNodeWithConditions creates healthy resources.
Add withUnhealthyResource helper and use it so the test genuinely
verifies that offline nodes skip resource checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Separate pacemaker health problems into two notification categories
(degraded-operations vs troubleshooting) so each banner links to the
relevant documentation section. Consolidate shared logic, add test
helpers, and point doc URLs to the published Red Hat docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the CR exists but the status collector CronJob hasn't run yet
(LastUpdated is zero), treat it the same as a missing CR to avoid
a false-positive troubleshooting banner at startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lucaconsalvi
lucaconsalvi force-pushed the ocpedge-2094-console-notification branch from f6b061e to b5e1f48 Compare July 21, 2026 14:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/tnf/hack/test-transition-events.sh`:
- Around line 65-66: Add an EXIT trap in test-transition-events.sh that executes
oc delete events for the tnf-test=true label in ${NAMESPACE}, ensuring cleanup
runs on both success and failure. Replace the existing cleanup-only echo with
the actual trap while preserving the current namespace and label selection.
- Around line 26-54: Update the test flow around the event-creation loop and its
callers so events are emitted through the production TNF transition path,
including RecordSetupEvent, rather than being created directly by this script.
Remove the manually fabricated event fixtures, then validate the actual emitted
events and messages, especially EtcdTransitionCompleted, against the production
behavior in the TNF transition flow.
- Line 62: Update the event validation command in test-transition-events.sh to
use a valid field selector and preserve failures from both oc and grep instead
of converting them to success. Validate every expected EtcdTransition event’s
reason, type, source, and message, while treating a genuine absence of matching
events as a failure rather than merely printing a fallback message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e0e8907e-ffc3-4a82-bf51-d375595340f3

📥 Commits

Reviewing files that changed from the base of the PR and between f6b061e and b5e1f48.

📒 Files selected for processing (10)
  • pkg/tnf/hack/test-transition-events.sh
  • pkg/tnf/operator/starter.go
  • pkg/tnf/pkg/etcd/etcd.go
  • pkg/tnf/pkg/etcd/etcd_test.go
  • pkg/tnf/pkg/pacemaker/consolenotification.go
  • pkg/tnf/pkg/pacemaker/consolenotification_test.go
  • pkg/tnf/pkg/pacemaker/healthcheck.go
  • pkg/tnf/pkg/pacemaker/healthcheck_test.go
  • pkg/tnf/pkg/tools/events.go
  • pkg/tnf/setup/runner.go
🚧 Files skipped from review as they are similar to previous changes (9)
  • pkg/tnf/pkg/etcd/etcd.go
  • pkg/tnf/setup/runner.go
  • pkg/tnf/pkg/pacemaker/consolenotification.go
  • pkg/tnf/pkg/etcd/etcd_test.go
  • pkg/tnf/pkg/tools/events.go
  • pkg/tnf/operator/starter.go
  • pkg/tnf/pkg/pacemaker/consolenotification_test.go
  • pkg/tnf/pkg/pacemaker/healthcheck.go
  • pkg/tnf/pkg/pacemaker/healthcheck_test.go

Comment thread pkg/tnf/hack/test-transition-events.sh
Comment thread pkg/tnf/hack/test-transition-events.sh
Comment thread pkg/tnf/hack/test-transition-events.sh
@fonta-rh

Copy link
Copy Markdown
Contributor

/approve

@fonta-rh

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-agnostic-ovn
/test e2e-agnostic-ovn-upgrade
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-aws-ovn-single-node
/test e2e-gcp-operator
/test e2e-gcp-operator-disruptive
/test e2e-metal-ipi-ovn-ipv6
/test e2e-operator

@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fonta-rh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 22, 2026
@lucaconsalvi

Copy link
Copy Markdown
Author

/test e2e-agnostic-ovn

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@lucaconsalvi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-agnostic-ovn b5e1f48 link true /test e2e-agnostic-ovn

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants